package com.itheima.d0_homework.timu2;

import java.util.ArrayList;
import java.util.Collection;

public class Test {
    public static void main(String[] args) {
    ArrayList <Student> list = new ArrayList<>();

        Student student = new Student(1,"小亮",99);
        Student student1 = new Student(2, "小强", 85);
        Student student2 = new Student(3, "小响", 90);
        Student student3 = new Student(4, "小勇", 75);


        list.add(student);
        list.add(student1);
        list.add(student2);
        list.add(student3);

        int index = 0;
        int score = list.get(0).getScore();

        for (int i = 0; i < list.size(); i++) {
            if(score > list.get(i).getScore()){
                score = list.get(i).getScore();
                index = i;
            }
        }
        list.remove(index);
        for (Student message : list) {
            System.out.println(message);
        }

    }

}
